package com.threegroup.android3grouppersonality.ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.threegroup.android3grouppersonality.R;

public class StartActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btn_startLogin;//去登陆
    private Button btn_startRegister;//去注册

    private Intent intent;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
        initView();
    }

    private void initView() {
        btn_startLogin=findViewById(R.id.btn_startLogin);
        btn_startRegister=findViewById(R.id.btn_startRegister);

        btn_startLogin.setOnClickListener(this);
        btn_startRegister.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btn_startLogin://跳转到登录页面
                intent=new Intent(this,LoginActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_startRegister://跳转到注册页面
                intent=new Intent(this,RegisterActivity.class);
                startActivity(intent);
                break;
        }
    }
}
